<!DOCTYPE html>
<html>
<head>
	<title>vue</title>
	<meta charset="UTF-8">
	<script src="./vue.js"></script>
</head>
<body>
	<div id="app">
		<div>{{fullName}}</div>
	</div>

	<script>
		var app = new Vue({
			el: '#app',
			data: {
				message: `<b>hello</b>`,
				firstName: 'dong',
				lastName: 'pengfei',
			},
			computed: {
				fullName: {
					get: function () {
						console.log('getter')
						return this.firstName + " " + this.lastName
					},
					set: function (val) {
						console.log('setter')
						let split = val.split(' ');
						this.firstName = split[0]
						this.lastName = split[1]
					}
				}
			}
		})
	</script>

</body>
</html>